/**
 * 
 */
package com.xinnet.mms.enums;


/**
 * 客户性质
 * @author 王志军
 * @since 2016-9-8
 * 
 */
public enum CustomerNatureEnmu {
	INDIVIDUALS(1,"个人"),
	COMPANIES(2,"公司");
	
	private Integer value;
	
	private String label;
	
	private CustomerNatureEnmu(Integer value, String label){
		this.value = value;
		this.label = label;
	}
	
	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
	
	
	/**
	 * 根据value获取对应的枚举
	 * @param value
	 * @return
	 */
	public static CustomerNatureEnmu getAllotTypeEnmuByValue(Integer value){
		CustomerNatureEnmu[] custEnums = CustomerNatureEnmu.values();
		for (CustomerNatureEnmu allotTypeEnmu : custEnums) {
			if(allotTypeEnmu.getValue().equals(value)){
				return allotTypeEnmu;
			}
		}
		return null;
	}
}
